{% extends 'base.html' %}

{% block title %}
    管理员 - {{ rid }} {{ name }}_电气信息学院请假管理系统
{% endblock title %}

{% block body %}
    <div class="container d-flex align-items-center" style="height: calc(100% - 62px);">
        <div class="itemcard">
            <div class="itemcard-menu">
                <ul class="pagination">
                    <li data-itemcard-menu="1" class="page-item active">
                        <button class="page-link"><i class="fa fa-address-card me-2"></i>用户信息</button>
                    </li>
                    <li data-itemcard-menu="2" class="page-item">
                        <button class="page-link"><i class="fa fa-sitemap me-2"></i>学生管理</button>
                    </li>
                    <li data-itemcard-menu="3" class="page-item">
                        <button class="page-link"><i class="fa fa-sitemap me-2"></i>教师管理</button>
                    </li>
                    <li data-itemcard-menu="4" class="page-item disabled">
                        <button class="page-link"><i class="fa fa-cogs"></i>设置</button>
                    </li>
                </ul>
            </div>
            <div data-itemcard-page="1" class="itemcard-page active">
                <div class="container">
                    <div class="row h-100 flex-nowrap align-items-center justify-content-center">
                        <div class="col col-2 col-lg-2 col-sm-3">
                            {% include 'includes/headcard.html' %}
                        </div>
                        <table class="col col-8 table table-striped table-bordered m-0" border="3" style="width: 30%;background-color: #fff;">
                            <thead>
                                <tr><th colspan="2">管理员信息</th></tr>
                            </thead>
                            <tbody>
                                <tr><td>ID</td><td>{{ rid }}</td></tr>
                                <tr><td>姓名</td><td>{{ name }}</td></tr>
                                <tr><td>性别</td><td>{{ gender }}</td></tr>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
            <div data-itemcard-page="2" class="itemcard-page">
                <div class="container">
                    <div class="row">
                        <div id="studentToolbar" class="col button-group">
                            <button class="btn btn-danger" id="btnStudentDelete">删除<i class="fa fa-trash-o ms-2"></i></button>
                            <button class="btn btn-warning" id="btnStudentModify">修改<i class="fa fa-pencil-square-o ms-2"></i></button>
                            <button class="btn btn-primary" id="btnStudentAdd">添加<i class="fa fa-plus-circle ms-2"></i></button>
                        </div>
                        <table id="studentTable" class="col"></table>
                    </div>
                </div>
            </div>
            <div data-itemcard-page="3" class="itemcard-page">
                <div class="container">
                    <div class="row">
                        <div id="teacherToolbar" class="col button-group">
                                <button class="btn btn-danger" id="btnTeacherDelete">删除<i class="fa fa-trash-o ms-2"></i></button>
                                <button class="btn btn-warning" id="btnTeacherModify">修改<i class="fa fa-pencil-square-o ms-2"></i></button>
                                <button class="btn btn-primary" id="btnTeacherAdd">添加<i class="fa fa-plus-circle ms-2"></i></button>
                        </div>
                        <table id="teacherTable" class="col"></table>
                    </div>
                </div>
            </div>
            <div data-itemcard-page="4" class="itemcard-page">
                设置
            </div>
        </div>
    </div>
{% endblock body %}

{% block script %}
    <script>
        let studentTable = teacherTable = null;
        $('[data-itemcard-menu="2"]').on('click', () => {
            if(studentTable) return $('#studentTable').bootstrapTable('refresh', {});
            studentTable = $('#studentTable').bootstrapTable({
                locale: 'zh-CN',
                toolbar: '#studentToolbar',
                toolbarAlign: 'left',
                buttonsOrder: ['paginationSwitch', 'toggle', 'fullscreen', 'refresh', 'columns'],
                showPaginationSwitch: true,
                showToggle: true,
                showFullscreen: true,
                showRefresh: true,
                showColumns: true,
                showButtonText: false,
                showHeader: true,
                showFooter: false,
                pagination: true,
                search: true,
                searchTimeOut: 300,
                minimumCountColumns: 6,
                clickToSelect: true,
                multipleSelectRow: true,
                detailView: true,
                detailViewIcon: true,
                detailFormatter: function(index, row, element) {
                    return `${row.name} (${row.sid}) ${row.department} ${row.faculty} ${row.major} ${row.class}班`;
                },
                sortable: true,
                url: '/admin/students?query=all',
                columns: [{
                    field: 'select',
                    title: '复选', 
                    checkbox: true, 
                }, {
                    field: 'on',
                    title: '序号', 
                    sortable: true,
                    align: 'center', 
                    width: 1,
                }, {
                    field: 'id', 
                    title: 'id', 
                    sortable: true,
                    align: 'center',
                    visible: false,
                }, {
                    field: 'sid', 
                    title: '学号', 
                    sortable: true,
                    align: 'center',
                }, {
                    field: 'name', 
                    title: '姓名', 
                    sortable: true,
                }, {
                    field: 'gender', 
                    title: '性别', 
                    sortable: true,
                }, {
                    field: 'tid', 
                    title: '辅导员 ID', 
                    sortable: true,
                    align: 'center',
                    visible: false,
                }, {
                    field: 'tname', 
                    title: '辅导员', 
                    sortable: true,
                }, {
                    field: 'department', 
                    title: '学部', 
                    sortable: true,
                }, {
                    field: 'faculty', 
                    title: '系别', 
                    sortable: true,
                }, {
                    field: 'major', 
                    title: '专业', 
                    sortable: true,
                }, {
                    field: 'grade', 
                    title: '年级', 
                    sortable: true,
                    align: 'center', 
                }, {
                    field: 'class', 
                    title: '班级', 
                    sortable: true,
                    align: 'center', 
                }],
                totalField: 'length',
                dataField: 'data',
                idField: 'sid',
                uniqueId: 'sid',
            });
            bindDragSelectEvent({
                $table: studentTable,
                uniqueId: 'sid'
            }),
            $('#btnStudentDelete').on('click', function() {
                let list = $('#studentTable').bootstrapTable('getSelections');
                if(list.length === 0) return dialogWarning('未选择任何数据!');
                let arr1 = [];
                for(row of list) {
                    arr1.push('<div class="col">' + row.sid + ' ' + row.name + "</div>");
                }
                let arr2 = [];
                if(arr1.length % 2 === 0) {
                    for(i in arr1) {
                        if(i % 2 !== 0) {
                            arr2.push('<div class="row">' + arr1[i-1] + arr1[i] + '</div>')
                        }
                    }
                }
                else {
                    if(arr1.length === 1) {
                        arr2.push('<div class="row">' + arr1[0] + '</div>')
                    }
                    else {
                        arr2.push('<div class="row">' + arr1[0])
                        for(i in arr1) {
                            if(i > 0 && i % 2 === 0 && i !== arr1.length - 1) {
                                arr2.push(arr1[i-1] + '</div><div class="row">' + arr1[i]);
                            }
                            if(i === arr1.length - 1) {
                                arr2[arr2.length - 1] = arr2[arr2.length - 1] + arr1[arr1.length - 1] + '</div>';
                            }
                        }
                    }
                }
                let html = '<div class="container">' + arr2.join('') + '</div>';
                dialogConfirm('警告', `<div class="my-1 text-center text-danger">确定要删除 ${list.length} 条数据吗? 该操作无法撤销!</div><br>` + html, () => {
                    let sids = list.map(value => value.sid);
                    let form = new FormData();
                    form.append('sids', sids);
                    let settings = {
                        async: !1,
                        crossDomain: !0,
                        url: "/admin/students",
                        method: "delete",
                        headers: {
                            "cache-control": "no-cache"
                        },
                        processData: !1,
                        contentType: !1,
                        mimeType: "multipart/form-data",
                        data: form
                    };
                    $.ajax(settings).done((function(data) {
                        $('#studentTable').bootstrapTable('refresh', {});
                    })).fail((function(jqXHR) {
                        let msg = JSON.parse(jqXHR.responseText).msg;
                        dialogWarning(msg);
                    }));
                });
            }),
            createConfirmModal({
                $button: $('#btnStudentModify'),
                indirectButton: true,
                id: 'modifyStudentModal',
                title: '修改学生信息',
                body: '<form id="modifyStudentForm" class="container rounded mx-auto"> <div class="row"> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入学号" name="sid"> <label class="form-label float-start" for="sid">学号</label> </div> </div> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入姓名" name="name"> <label class="form-label" for="name">姓名</label> </div> </div> <div class="col"> <div class="form-floating"> <select class="form-select" name="gender"> <option value="男">男</option> <option value="女">女</option> </select> <label class="form-label" for="gender">性别</label> </div> </div> </div> <div class="form-floating mt-3"> <select name="assistant" class="form-select"> <option value="None">None</option> </select> <label for="assistant" class="form-label">辅导员</label> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入学部" name="department"> <label class="form-label" for="department">学部</label> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入系别" name="faculty"> <label class="form-label" for="faculty">系别</label> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入专业" name="major"> <label class="form-label" for="major">专业</label> </div> <div class="row mt-3"> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入年级" name="grade"> <label class="form-label" for="grade">年级</label> </div> </div> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入班级" name="class"> <label class="form-label" for="class">班级</label> </div> </div> </div> </form>',
                buttonClick: function(e, $modal, $button) {
                    let list = $('#studentTable').bootstrapTable('getSelections');
                    if(list.length === 0) return dialogWarning('未选择任何数据!');
                    $modal.show();
                    if(list.length > 1) {
                        $modal.setTitle(`批量修改学生数据 (共 ${list.length} 个)`);
                    }
                    else {
                        $modal.setTitle(`修改用户 - ${list[0].name}`);
                    }
                    $(document.forms.modifyStudentForm['sid']).removeAttr('disabled'),
                    $(document.forms.modifyStudentForm['name']).removeAttr('disabled'),
                    $(document.forms.modifyStudentForm['gender']).removeAttr('disabled');
                    let row = list[0];
                    if(row) {
                        if(list.length > 1) {
                            $(document.forms.modifyStudentForm['sid']).attr('disabled', 'true'),
                            $(document.forms.modifyStudentForm['name']).attr('disabled', 'true'),
                            $(document.forms.modifyStudentForm['gender']).attr('disabled', 'true');
                            document.forms.modifyStudentForm['sid'].value    = '多个值';
                            document.forms.modifyStudentForm['name'].value   = '多个值';
                            document.forms.modifyStudentForm['gender'].value = '多个值';
                        }
                        else {
                            $(document.forms.modifyStudentForm['sid']).attr('disabled', 'true');
                            document.forms.modifyStudentForm['sid'].value    = row.sid;
                            document.forms.modifyStudentForm['name'].value   = row.name;
                            document.forms.modifyStudentForm['gender'].value = row.gender;
                        }
                        initAssistantSelect(document.forms.modifyStudentForm['assistant'], row.tid);
                        document.forms.modifyStudentForm['department'].value = row.department;
                        document.forms.modifyStudentForm['faculty'].value    = row.faculty;
                        document.forms.modifyStudentForm['major'].value      = row.major;
                        document.forms.modifyStudentForm['grade'].value      = row.grade;
                        document.forms.modifyStudentForm['class'].value      = row.class;
                    }
                },
                confirmClick: function() {
                    let selections = $('#studentTable').bootstrapTable('getSelections');
                    let ids = selections.map(value => value.id);

                    let name = document.forms.modifyStudentForm['name'].value;
                    let gend = document.forms.modifyStudentForm['gender'].value;
                    let tid = document.forms.modifyStudentForm['assistant'].value;
                    let depa = document.forms.modifyStudentForm['department'].value;
                    let facu = document.forms.modifyStudentForm['faculty'].value;
                    let majo = document.forms.modifyStudentForm['major'].value;
                    let grad = document.forms.modifyStudentForm['grade'].value;
                    let clas = document.forms.modifyStudentForm['class'].value;

                    let form = new FormData();
                    form.append('ids', ids);
                    form.append('name', name);
                    form.append('gender', gend);
                    form.append('tid', tid);
                    form.append('department', depa);
                    form.append('faculty', facu);
                    form.append('major', majo);
                    form.append('grade', grad);
                    form.append('class', clas);
                    form.append('action', 'modify');
                    $.ajax({
                        async: !1,
                        crossDomain: !0,
                        url: "/admin/students",
                        method: "POST",
                        headers: {
                            "cache-control": "no-cache"
                        },
                        processData: !1,
                        contentType: !1,
                        mimeType: "multipart/form-data",
                        data: form
                    }).done((function(data) {
                        data = JSON.parse(data);

                        dialogInfo(data.msg, function() {
                            $('#modifyStudentModal').get(0).hide(),
                            $('#studentTable').bootstrapTable('refresh');
                        });
                    })).fail((function(jqXHR) {
                        dialogError(JSON.parse(jqXHR.responseText).msg);
                    }));
                },
            }),
            createConfirmModal({
                $button: $('#btnStudentAdd'),
                id: 'addStudentModal',
                title: '添加学生信息',
                body: '<form id="addStudentForm" class="container rounded mx-auto"> <div class="row"> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入学号" name="sid" value="系统自动生成" disabled> <label class="form-label float-start" for="sid">学号</label> </div> </div> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入姓名" name="name"> <label class="form-label" for="name">姓名</label> </div> </div> <div class="col"> <div class="form-floating"> <select class="form-select" name="gender"> <option value="男">男</option> <option value="女">女</option> </select> <label class="form-label" for="gender">性别</label> </div> </div> </div> <div class="form-floating mt-3"> <select name="assistant" class="form-select"> <option value="None">None</option> </select> <label for="assistant" class="form-label">辅导员</label> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入学部" name="department"> <label class="form-label" for="department">学部</label> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入系别" name="faculty"> <label class="form-label" for="faculty">系别</label> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入专业" name="major"> <label class="form-label" for="major">专业</label> </div> <div class="row mt-3"> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入年级" name="grade"> <label class="form-label" for="grade">年级</label> </div> </div> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入班级" name="class"> <label class="form-label" for="class">班级</label> </div> </div> </div> </form>',
                buttonClick: function() {
                    initAssistantSelect(document.forms.addStudentForm['assistant']);
                },
                confirmClick: function() {
                    let name = document.forms.addUserForm['name'].value;
                    let password = document.forms.addUserForm['password'].value;
                    if(!name || !password) return dialogWarning('用户名和密码不能为空');

                    let password_check = document.forms.addUserForm['password-check'].value;
                    if(password != password_check) return dialogWarning('密码不一致');

                    let form = new FormData();
                    form.append('name', name);
                    form.append('password', password);
                    form.append('action', 'add');
                    $.ajax({
                        async: !1,
                        crossDomain: !0,
                        url: "/admin/students",
                        method: "POST",
                        headers: {
                            "cache-control": "no-cache"
                        },
                        processData: !1,
                        contentType: !1,
                        mimeType: "multipart/form-data",
                        data: form
                    }).done((function(data) {
                        dialogInfo('添加成功, 请刷新页面查看');
                    })).fail((function(jqXHR) {
                        dialogError(JSON.parse(jqXHR.responseText).msg);
                    }));
                },
            });
        }),
        $('[data-itemcard-menu="3"]').on('click', () => {
            if(teacherTable)  return $('#teacherTable').bootstrapTable('refresh', {});
            teacherTable = $('#teacherTable').bootstrapTable({
                locale: 'zh-CN',
                toolbar: '#teacherToolbar',
                toolbarAlign: 'left',
                buttonsOrder: ['paginationSwitch', 'toggle', 'fullscreen', 'refresh', 'columns'],
                showPaginationSwitch: true,
                showToggle: true,
                showFullscreen: true,
                showRefresh: true,
                showColumns: true,
                showButtonText: false,
                showHeader: true,
                showFooter: false,
                pagination: true,
                search: true,
                searchTimeOut: 300,
                minimumCountColumns: 3,
                clickToSelect: true,
                multipleSelectRow: true,
                detailView: true,
                detailViewIcon: true,
                detailFormatter: function(index, row, element) {
                    return `${row.name} ${row.telphone}`;
                },
                sortable: true,
                url: '/admin/teachers?query=all',
                columns: [{
                    checkbox: true, 
                }, {
                    field: 'on',
                    title: '序号', 
                    sortable: true,
                    align: 'center', 
                    width: 1,
                }, {
                    field: 'id', 
                    title: 'id', 
                    sortable: true,
                    align: 'center',
                    visible: false,
                }, {
                    field: 'tid', 
                    title: '教师编号', 
                    sortable: true,
                    align: 'center',
                }, {
                    field: 'name', 
                    title: '姓名', 
                    sortable: true,
                }, {
                    field: 'gender', 
                    title: '性别', 
                    sortable: true,
                    align: 'center', 
                }, {
                    field: 'telphone', 
                    title: '电话号码', 
                    sortable: true,
                    align: 'center',
                }, {
                    field: 'role', 
                    title: '职能', 
                    sortable: true,
                }],
                totalField: 'length',
                dataField: 'data',
                idField: 'tid',
                uniqueId: 'tid',
            });
            bindDragSelectEvent({
                $table: teacherTable,
                uniqueId: 'tid'
            }),
            $('#btnTeacherDelete').on('click', function() {
                let list = $('#teacherTable').bootstrapTable('getSelections');
                if(list.length === 0) return dialogWarning('未选择任何数据!');
                let arr1 = [];
                for(row of list) {
                    arr1.push('<div class="col">' + row.tid + ' ' + row.name + "</div>");
                }
                let arr2 = [];
                if(arr1.length % 2 === 0) {
                    for(i in arr1) {
                        if(i % 2 !== 0) {
                            arr2.push('<div class="row">' + arr1[i-1] + arr1[i] + '</div>')
                        }
                    }
                }
                else {
                    if(arr1.length === 1) {
                        arr2.push('<div class="row">' + arr1[0] + '</div>')
                    }
                    else {
                        arr2.push('<div class="row">' + arr1[0])
                        for(i in arr1) {
                            if(i > 0 && i % 2 === 0 && i !== arr1.length - 1) {
                                arr2.push(arr1[i-1] + '</div><div class="row">' + arr1[i]);
                            }
                            if(i === arr1.length - 1) {
                                arr2[arr2.length - 1] = arr2[arr2.length - 1] + arr1[arr1.length - 1] + '</div>';
                            }
                        }
                    }
                }
                let html = '<div class="container">' + arr2.join('') + '</div>';
                dialogConfirm('警告', `<div class="my-1 text-center text-danger">确定要删除 ${list.length} 条数据吗? 该操作无法撤销!</div><br>` + html, () => {
                    let tids = list.map(value => value.tid);
                    let form = new FormData();
                    form.append('tids', tids);
                    let settings = {
                        async: !1,
                        crossDomain: !0,
                        url: "/admin/teachers",
                        method: "delete",
                        headers: {
                            "cache-control": "no-cache"
                        },
                        processData: !1,
                        contentType: !1,
                        mimeType: "multipart/form-data",
                        data: form
                    };
                    $.ajax(settings).done((function(data) {
                        $('#teacherTable').bootstrapTable('refresh', {});
                    })).fail((function(jqXHR) {
                        let msg = JSON.parse(jqXHR.responseText).msg;
                        dialogWarning(msg);
                    }));
                });
            }),
            createConfirmModal({
                $button: $('#btnTeacherModify'),
                indirectButton: true,
                id: 'modifyTeacherModal',
                title: '修改教师信息',
                body: '<form id="modifyTeacherForm" class="container rounded mx-auto"> <div class="row"> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入教师编号" name="tid"> <label class="form-label" for="tid">教师编号</label> </div> </div> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入姓名" name="name"> <label class="form-label" for="name">姓名</label> </div> </div> <div class="col"> <div class="form-floating"> <select class="form-select" name="gender"> <option value="男">男</option> <option value="女">女</option> </select> <label class="form-label" for="gender">性别</label> </div> </div> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入电话号码" name="telphone"> <label class="form-label" for="telphone">电话号码</label> </div> <div class="form-floating mt-3"> <select class="form-select" name="role"> <option value="辅导员">辅导员</option> <option value="教务处">教务处</option> <option value="考勤">考勤</option> </select> <label class="form-label" for="role">职能</label> </div> </form>',
                buttonClick: function(e, $modal, $button) {
                    let list = $('#teacherTable').bootstrapTable('getSelections');
                    if(list.length === 0) return dialogWarning('未选择任何数据!');
                    $modal.show();
                    if(list.length > 1) {
                        $modal.setTitle(`批量修改教师数据 (共 ${list.length} 个)`);
                    }
                    else {
                        $modal.setTitle(`修改用户 - ${list[0].name}`);
                    }
                    $(document.forms.modifyTeacherForm['tid']).removeAttr('disabled'),
                    $(document.forms.modifyTeacherForm['name']).removeAttr('disabled'),
                    $(document.forms.modifyTeacherForm['gender']).removeAttr('disabled'),
                    $(document.forms.modifyTeacherForm['telphone']).removeAttr('disabled');
                    let row = list[0];
                    if(row) {
                        if(list.length > 1) {
                            $(document.forms.modifyTeacherForm['tid']).attr('disabled', 'true'),
                            $(document.forms.modifyTeacherForm['name']).attr('disabled', 'true'),
                            $(document.forms.modifyTeacherForm['telphone']).attr('disabled', 'true');
                            document.forms.modifyTeacherForm['tid'].value      = '多个值';
                            document.forms.modifyTeacherForm['name'].value     = '多个值';
                            document.forms.modifyTeacherForm['gender'].value   = '';
                            document.forms.modifyTeacherForm['telphone'].value = '多个值';
                            document.forms.modifyTeacherForm['role'].value     = '';
                        }
                        else {
                            document.forms.modifyTeacherForm['tid'].value      = row.tid;
                            document.forms.modifyTeacherForm['name'].value     = row.name;
                            document.forms.modifyTeacherForm['gender'].value   = row.gender;
                            document.forms.modifyTeacherForm['telphone'].value = row.telphone;
                            document.forms.modifyTeacherForm['role'].value     = row.role;
                        }
                    }
                },
                confirmClick: function() {
                    let selections = $('#teacherTable').bootstrapTable('getSelections');
                    let ids = selections.map(value => value.id);
                    let tids = selections.map(value => value.tid);

                    let tid = document.forms.modifyTeacherForm['tid'].value;
                    let name = document.forms.modifyTeacherForm['name'].value;
                    let gend = document.forms.modifyTeacherForm['gender'].value;
                    let telp = document.forms.modifyTeacherForm['telphone'].value;
                    let role = document.forms.modifyTeacherForm['role'].value;

                    let form = new FormData();
                    form.append('ids', ids);
                    form.append('tids', tids);
                    form.append('name', name);
                    form.append('gender', gend);
                    form.append('telphone', telp);
                    form.append('role', role);
                    form.append('action', 'modify');
                    $.ajax({
                        async: !1,
                        crossDomain: !0,
                        url: "/admin/teachers",
                        method: "POST",
                        headers: {
                            "cache-control": "no-cache"
                        },
                        processData: !1,
                        contentType: !1,
                        mimeType: "multipart/form-data",
                        data: form
                    }).done((function(data) {
                        data = JSON.parse(data);

                        dialogInfo(data.msg, function() {
                            $('#modifyTeacherModal').get(0).hide(),
                            $('#teacherTable').bootstrapTable('refresh');
                        });
                    })).fail((function(jqXHR) {
                        dialogError(JSON.parse(jqXHR.responseText).msg);
                    }));
                },
            }),
            createConfirmModal({
                $button: $('#btnTeacherAdd'),
                id: 'addTeacherModal',
                title: '添加教师信息',
                body: '<form id="addTeacherForm" class="container rounded mx-auto"> <div class="row"> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入教师编号" name="tid"> <label class="form-label" for="tid">教师编号</label> </div> </div> <div class="col"> <div class="form-floating"> <input class="form-control" type="text" placeholder="请输入姓名" name="name"> <label class="form-label" for="name">姓名</label> </div> </div> <div class="col"> <div class="form-floating"> <select class="form-select" name="gender"> <option value="男">男</option> <option value="女">女</option> </select> <label class="form-label" for="gender">性别</label> </div> </div> </div> <div class="form-floating mt-3"> <input class="form-control" type="text" placeholder="请输入电话号码" name="telphone"> <label class="form-label" for="telphone">电话号码</label> </div> <div class="form-floating mt-3"> <select class="form-select" name="role"> <option value="辅导员">辅导员</option> <option value="教务处">教务处</option> <option value="考勤">考勤</option> </select> <label class="form-label" for="role">职能</label> </div> </form>',
                buttonClick: function() {

                },
                confirmClick: function() {

                },
            });
        });
    </script>
{% endblock %}
